package src.week7.SHIYAN4.Rational;

/**
 * @Author： 20192315裴湘瑞
 * @Date: 2020/10/27 22:13
 * @Version: 1.0
 * @Target：实现有理数类(加减乘除运算）
 * @Requirement：
 */

import java.util.Scanner;

public class CalculatorTest {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        System.out.println("请输入第一个分数(格式:a/b)");
        String data1 = input.next();
        System.out.println("请输入要进行运算的运算符(+ or - or * or /)");
        String operation = input.next();
        System.out.println("请输入第二个分数(格式:c/d)");
        String data2 = input.next();

        Calculator cal = new Calculator();
        System.out.println("运算结果为:");
        cal.compute(data1, operation, data2);
    }
}


